package com.membership.stumembership.controller;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.membership.stumembership.domain.Student;
import com.membership.stumembership.service.StudentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/student")
@RequiredArgsConstructor
public class StudentController {
    private final StudentService studentService;

    @RequestMapping("/getAll")
    public Object selectAll(){
        return studentService.list((Wrapper<Student>) null);
    }

    @RequestMapping("/selectByPage")
    public Object selectByPage(Student stu, Page<Student>page){
        return studentService.selectByPage(page,stu);
    }
}
